package com.bittech.chatroom.web.view;

import freemarker.template.Template;
import freemarker.template.TemplateException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * @Author: yuisama
 * @Date: 2019-06-25 16:16
 * @Description:
 */
@WebServlet(urlPatterns = "/tryRegistration")
public class UserRegViewServlet extends BaseViewServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Template template = getTemplate("/registration.ftl",req,resp);
        Object o = new Object();
        try {
            resp.setContentType("text/html; charset=" + template.getEncoding());
            template.process(o,resp.getWriter());
        } catch (TemplateException e) {
            e.printStackTrace();
        }
    }
}
